package com.bawei.park2211a.adapter

import com.bawei.base.bean.PersonListEntity
import com.bawei.park2211a.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class PersonAdapter:BaseQuickAdapter<PersonListEntity,BaseViewHolder>(R.layout.item_person) {
    var occupation=""
    var department=""
    override fun convert(helper: BaseViewHolder, item: PersonListEntity) {
        helper.setText(R.id.person_name,item.name)
        when(item.departmentId){
            2->{
                occupation="高级研发师"
                department="研发部"
            }
            3->{
                occupation="高级安卓开发工程师"
                department="技术部"
            }
            4->{
                occupation="人力资源总经理"
                department="市场部"
            }
            6->{
                occupation="安保科长"
                department="安保部"
            }
        }
        helper.setText(R.id.person_department,department)
        helper.setText(R.id.person_occupation,occupation)
    }
}